package com.ztgf.commodity.api.client;

import com.ztgf.commodity.models.bo.CommodityArrivalGoodsRemindSaveBO;
import com.ztgf.commodity.models.service.ICommodityArrivalGoodsRemindService;
import com.ztgf.common.constant.Result;
import com.ztgf.common.enums.CodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品到货提醒表控制器
 *
 * @author chenyu.wang
 * @Date 2020-06-23 15:58:01
 */

@RestController
@RequestMapping("/api/commodityArrivalGoodsRemind")
@Slf4j
@Api(value = "CommodityArrivalGoodsRemindApiController", tags = "商品到货提醒表Api接口")
public class CommodityArrivalGoodsRemindApiController {

    @DubboReference
    private ICommodityArrivalGoodsRemindService commodityArrivalGoodsRemindService;


    @PostMapping(value = "/insert")
    @ApiOperation(value = "添加到货提醒", notes = "添加到货提醒")
    public Result insert(CommodityArrivalGoodsRemindSaveBO saveBO) {
        boolean flag = commodityArrivalGoodsRemindService.add(saveBO);
        if (flag) {
            return new Result<>();
        }
        return new Result<>(CodeEnum.FAIL_100007);
    }
}
